/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/** 
 * \file
 * \brief Very simple testobject for FSRSim - header.
 * \author Antti Maula <antti.maula@tkk.fi>
 */
#ifndef _FSRSIM_LANDMINE_H_
#define _FSRSIM_LANDMINE_H_

#include "Object.h"
#include "Shapes.h"

/** LandMine object
 * 
 * Exercise object by Antti Maula. Not really useful for anything else than exercising :)
 */
class CLandMine : public CObject
{
  public:
  CLandMine(CWorld *World, const float position_x, 
            const float position_y, const float position_z,
            const float radius);
    
    ~CLandMine();
    
    void Update(float StepSize);
    
    void OnCollision(CPrimitive *primitive, int numc, dContact *contacts, CPrimitive *primitive2);
    
    void Draw();
    
    void Activate();
    

    /** Construct a CLandMine instance from XML.
     *
     * @param[in] world         Pointer to assigned world
     * @param[in] node          Pointer to XML node to start reading from.
     * @return                  Returns pointer which should have been added to World ;)
     */
    static CObject* LoadMLMA(CWorld *world, xmlNode *node);
    
  private:
    TMaterial iMaterialBase;
    TMaterial iMaterialIgniter;
    float iBaseRadius;
    float iBaseHeight;
    float iIgniterRadius;
    float iIgniterHeight;
    CCylinder iMineBase;
    CBox iMineIgniter;

    bool iIsHit;
    bool iIsVisible;
};

#endif
